<?=$this->load->view('public/v_html')?>
<title>给力网 --会员中心</title>
<link href="<?=base_url('./css/user/qbase_datauri.css') ?>"
	type="text/css" rel="stylesheet">
<link rel="stylesheet" type="text/css"
	href="<?=base_url('./css/user/qcenter_datauri.css') ?>">
<link rel="stylesheet" type="text/css"
	href="<?=base_url('./css/user/qcomment_datauri.css') ?>">
<script src="<?=base_url('js/tbk.js') ?>"></script>
<script type="text/javascript">
$("input[name=button]").live("click", function (){ 
	var my_str = $("input[name=tao_user]").val();
	$("#add_taobao").html("<img src=<?=base_url('images/loading.gif') ?> />");
	$.ajax({
		type:'POST',
		url:'<?=site_url('user/index/taobao_add') ?>',
		data:{"tao_user":my_str},
		success:function (data){
			thm = "亲爱的用户：你绑定的支付宝账号是<div id=edit_tao class=feed-act-box><span id=tao_a>"+my_str+"</span> <a id=tao_edit>修改</a></div>";
			if(data){
				$("#add_taobao").html(thm)
				$("input[name=tao_user]").val(my_str)
			}else
				$("#add_taobao").html("更新失败！！");
		}
				
	})
})
$("#tao_edit").live("click", function (){ 
	var str = "<input type=text name=tao_user /><input name=button type=button value=提交 />";
	$("#edit_tao").html(str);
})
function taobao_2(){
	var str = "请输入的的支付宝账号：<input type=text name=tao_user /><input name=button type=button value=提交 />";
	$("#taobao").html(str);
}
</script>
<style type="text/css">
.report td {
	padding: 2px 5px 2px 5px;
}

.money {
	border: #999 dashed 1px;
	background-color: #FF4646;
	margin: 10px 0px 10px 0px;
	color: #fff;
	padding: 5px 2px 2px 2px;
}

.errors {
	background: #FFCECE
		url(<?=       base_url('images/icons/cross_circle.png')?>);
	background-repeat: no-repeat;
	margin: 10px 0px 10px 0px;
	padding: 0px 0px 0px 17px;
	color: red;
}

.mod-side-radio a {
	padding: 10px;
}
</style>
<link rel="stylesheet" type="text/css"
	href="<?=base_url('./css/taobao/base.css') ?>">
<link rel="stylesheet" type="text/css"
	href="<?=base_url('./css/taobao/bought.css') ?>">
<link rel="stylesheet" type="text/css"
	href="<?=base_url('./css/taobao/tbsp.css') ?>">
<script type="text/javascript">
var check_url = "<?=site_url('user/index/check_num') ?>";
</script>
<script type="text/javascript" src="<?=base_url('js/user/check.js') ?>"></script>
</head>
<body>
	<!-- 头部导航文件 -->
<?php if(isset($usermail)):?>
<?=$this->load->view('public/v_header',$usermail)?>
<?php else: ?>
<?=$this->load->view('public/v_header')?>
<?php endif; ?>
	<section class="mod-page-body">
		<div class="mod-page-main wordwrap clearfix">
			<div class="x-page-container">
				<section class="mod-main-box">
					<div class="mod-page-bg-wraper">
						<div id="qcenterBody" class="grid-98 mod-main-wraper clearfix">
							<div id="yyAdvLink"></div>
							<div class="grid-75 left">
								<section id="ent" class="mod-ent-wraper clearfix">
									<div class="mod-ent clearfix">
										<div class="ent-tip-logo">
											<div href="#" class="ent-user-box" id="entUserBox">
												<a class="user-img-link" href="#" title="<?=$usermail?>"><img
													class="ent-user-portrait"
													src="<?=base_url('images/user_image/head.jpg') ?>"
													alt="<?=$usermail?>"></a>
											</div>
										</div>
									</div>
								</section>
								<section class="mod-feed-main-content" id="feedMainContent">
									<div class="mod-feed-list-box" id="feedListBox">
										<article class="feed-item clearfix support-3d"
											data-guid="$sp_guid$_2">
											<div class="feed-detail-content-wraper">
												<div class="feed-detail-info-box">
													<div class="feed-detail-info-wraper" style="width: 650px;">

														<div class="feed-bottom-box">
														<?php if(@$tao_user!=""):?>
															<div class="feed-act-box clearfix " id="add_taobao">
																亲爱的用户：你绑定的支付宝账号是：
																<div id="edit_tao" class="feed-act-box">
																	<span id="tao_a"><?=$tao_user?></span> <a id="tao_edit">修改</a>
																</div>
															</div>
															<div>
																<div class="money">
																	可提取金额:<strong style="font-size: 16px; padding: 5px;"><?=($fanli-$is_fanli-$rebate_cash)?></strong>&nbsp;已返利:<?=$is_fanli?>&nbsp;申请中的金额: <strong
																		style="font-size: 14px; padding: 5px; color: #fff"><?=$rebate_cash?></strong>
																</div>
																<?php if($rebate_cash == "0.00"):?>
																<form id="form"
																	action="<?=site_url('user/index/rebate_add')?>"
																	method="post">
																	申请返现: <input name="fanli" class="valid_num"
																		check_error="输入的格式不合法" error_dom_id="提交金额不能为空"
																		type="text" size="10" /> <input type="hidden"
																		name="tao_user" value="<?=$tao_user?>" /> <input
																		type="hidden" name="can_user"
																		value="<?=($fanli-$is_fanli)?>"> <input type="submit"
																		value="提交申请" />
																</form>
																<div class="errors"></div>
																<?php else :?>
																	<div style="color: #C2F">您已提交返现申请，审核中…………</div>
																<?php endif;?>
															</div>
															<?php ELSE:?>
															<div class="feed-act-box clearfix " STYLE="COLOR: RED">
																亲爱的用户： 请点击<a onclick="taobao_2()">这里</a>绑定支付宝账号查看钱包，并能让我们正常的把返利返还到你的支付宝账号上
															</div>
															<div id="taobao" class="feed-act-box clearfix"></div>
														<?php endif;?>
														<?php
														if (@$login_from != "") {
															if (@$email == "") {
																?>
																<div>亲，绑定邮箱，在返利到账时我们好邮件提醒哦！</div>
															<div>
																<form action="<?=site_url('user/index/email_update') ?>"
																	method="post">
																	邮箱:<input type="text" name="email" size="20" /> <input
																		type="hidden" name="login_from"
																		value="<?=$login_from?>" /> <input type="submit"
																		value="提交" />
																</form>
															</div>
															<?php
															
															}
														}
														?>
														</div>

														<div class="feed-bottom-box">
															<table class="bought-table" id="J_BoughtTable"
																data-spm="9">
																<thead>
																	<tr class="col-name">
																		<th></th>
																		<th class="baobei">宝贝</th>
																		<th class="price">单价(元)</th>
																		<th class="quantity">数量</th>
																		<th class="price">返利金额</th>
																		<th class="amount">返利状态</th>
																		<th class="amount">实付款(元)</th>
																		<th class="amount">共返利(元)</th>
																		<th class="trade-status"></th>
																	</tr>
																	<tr class="sep-row">
																		<td colspan="9"></td>
																	</tr>
																</thead>
																<?php
																foreach ( $table as $key => $v ) :
																	?>
																
																<tbody id="item<?$key ?>" data-isarchive="false"
																	data-orderid="203468244028627"
																	data-status="TRADE_FINISHED"
																	class=" combo-order success-order">
																	<tr class="sep-row">
																		<td colspan="9"></td>
																	</tr>
																	<tr class="order-hd">
																		<td colspan="9"><span class="no"> <label> <em
																					class="selector"></em> 订单编号：<span class="order-num"><?=$key ?></span>
																			</label>
																		</span> <span class="deal-time">成交时间：<?=$v["pay_time"] ?></span>
																		</td>
																	</tr>
																	<tr class="order-bd">
																		<td class="baobei" colspan="2"><?=$v["detail"][0]->item_title ?></td>
																		<td class="price"
																			title="<?=$v["detail"][0]->real_pay_fee ?>"><?=$v["detail"][0]->real_pay_fee ?></td>
																		<td class="quantity"
																			title="<?=$v["detail"][0]->item_num ?>"><?=$v["detail"][0]->item_num ?></td>
																		<td class="price"><?=($v["detail"][0]->commission/2) ?></td>
																		<td class="price"><?=$v["detail"][0]->is_fanli==0?"否":"是" ?></td>
																		<td class="amount" rowspan=<?=$v["num"] ?>><strong><?=$v["pay_sum"] ?></strong>
																		</td>
																		<td class="other commission_sum"
																			rowspan=<?=$v["num"] ?>><strong><?=($v["commission_sum"]/2) ?></strong>
																		</td>
																		<td class="other" rowspan=<?=$v["num"] ?>></td>
																	</tr>
																	<?php
																	
																	foreach ( $v ["detail"] as $id => $vv ) :
																		if ($id == 0)
																			continue;
																		?>
																	<tr class="order-bd">
																		<td class="baobei" colspan="2"><?=$vv->item_title ?></td>
																		<td class="price" title="<?=$vv->real_pay_fee ?>"><?=$vv->real_pay_fee ?></td>
																		<td class="quantity" title="<?=$vv->item_num ?>"><?=$vv->item_num ?></td>
																		<td class="price"><?=($vv->commission/2) ?></td>
																		<td class="price"><?=$vv->is_fanli==0?"否":"是" ?></td>
																	</tr>
																	<?php endforeach;?>
																</tbody>
																<?php endforeach;?>
																<tfoot>
																	<tr class="sep-row">
																		<td colspan="9"></td>
																	</tr>
																	<tr class="toolbar skin-gray">
																		<td colspan="3"></td>
																		<td class="page-nav-cell" colspan="6">
																			共<?=$page?>
																		</td>
																	</tr>
																</tfoot>
															</table>
														</div>
													</div>
													<div class="feed-cmt-box hide"></div>
												</div>
												<div class="feed-content-shadow"></div>
											</div>
										</article>
									</div>

								</section>
							</div>
							<div class="grid-23 right">
								<div class="mod-side-wraper">
									<section class="mod-side-item mod-side-userbar">
										<div class="user-desc-box clearfix">
											<a class="user-name"><?=$usermail ?></a><a href="#"
												class="user-set" title="个人中心设置">设置</a>
										</div>
									</section>
									<section class="mod-side-item mod-side-tags">
										<div class="tag-list hide" id="side-tag-list"></div>
										<a class="see-more-box clearfix" id="side-tag-seemore">
											<div class="tag-more-shadow-top"></div>
											<div class="tag-more-icon"></div> <em class="tag-more-name">帮助中心</em>
										</a>
									</section>
									<section class="mod-side-item mod-side-radio">
										<ul>
											<li><a id="trade_find">没有订单信息怎么办？</a></li>
										</ul>
									</section>
								</div>
							</div>
						</div>
					</div>
				</section>
			</div>
		</div>
	</section>
	<div id="message" style="display: none"><?=$this->view("public/messagebox") ?></div>
	<footer class="mod-footer">
		<div class="clearfix hidden-box"></div>
		<div class="footer-box">
			<div class="copy-box"><?=$this->_lang['copy_right']?></div>
		</div>
	</footer>
	<script type="text/javascript">
	var func = function (){
		var trade_parent_id = $.trim($("input[name=trade_parent_id]").val());
		var a = /\'\/^\\s*$|^c:\\\\con\\\\con$|[%,\\*\\"\\s\\t\\<\\>\\&\'\\\\]/;
		var c=false;
		if(!a.test(trade_parent_id)&&trade_parent_id){
			$.ajax({
				type:'POST',
				url:"<?=site_url('help/trade_check_is') ?>",
				data:{"trade_parent_id":trade_parent_id},
				success:function (data){
					eval("var res="+data);
					switch (res.state){
					case 1:
						alert("操作成功！");
						c=true;
						location.href = location.href;break;
					case 2:
						alert("操作失败！");break;
					case 0:
						alert("订单号不存在！");break;
					}
				}
			})
		}else{
			alert("哥！你不能这么搞哦！");
		}
		if(!c){
			return false;
		}
	}
	
	$("#trade_find").click(function () {
		title = "找回订单";
		data = $("#message").html();
		messageBox(title,data,func);
	});
	
	</script>
</body>
</html>